package com.itheima.test1;

public class Test1Polymorphic {
    public static void main(String[] args) {
        //当前事物是一只动物
        Animal a = new Cat();
        //当前事物是一只猫
        Cat c = new Cat();
    }
}



class Animal{
    public void eat(){
        System.out.println("动物吃饭");
    }
}


class Cat extends Animal{
    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
}